<?php

namespace app\admin\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class DriverTest extends CommonTest
{

    //再命令窗口中执行“php think interface-DriverTest”
    protected function configure()
    {
        $this->setName('interface-DriverTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('admin/driver/create', 'admin/driver/toAddDriver');                                                          // 添加司机
//        $data = Tools::curl($this->url . "admin/driver/create", json_encode(["token" => "$this->token", "nickname" => "xx司机", "mobile" => "13682731698", "avatar" => "xxx", "email" => "xx@xx.com", "openid" => "wxee", "idCard" => "445281199612121311", "vehicle" => "sd", "drivingAge" => "2", "driverImg" => "xxx", "certificateImg" => "xx", "address" => "xx"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/driver/getPageList', 'admin/driver/getDriverList');                                                   // 司机列表，分页功能
        $data = Tools::curl($this->url . "admin/driver/getPageList", json_encode(["token" => "$this->token", "pageSize" => 1]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";

        //Route::any('admin/driver/getDetailsById', 'admin/driver/getDriverDetail');                                              // 司机的详细信息
//        $data = Tools::curl($this->url . "admin/driver/getDetailsById", json_encode(["token" => "$this->token", "id" => 1]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

    }
}
